package br.edu.ufc.deti.connection;
import org.libvirt.*;
public class LibvirtConnection {
	public static void main(String[] args) {
        Connect conn=null;
        try{
            conn = new Connect("qemu:///system");
        } catch (LibvirtException e){
            System.out.println("exception caught:"+e);
            System.out.println(e.getError());
        }
        try{
            Domain testDomain=conn.domainLookupByName("ubuntu");
            System.out.println(" Domain:" + testDomain.getName() +
            					"\n id: " + testDomain.getID() + 
            					"\n running: " + testDomain.getOSType()+
            					"\n MaxVcpus: " + testDomain.getMaxVcpus()
            					);
        } catch (LibvirtException e){
            System.out.println("exception caught:"+e);
            System.out.println(e.getError());
        }
	}
}
